﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Timers;
using System.Threading;
using System.Text.RegularExpressions;
using LotteryNumsCollect.LotterySrv;
using System.Collections.ObjectModel;
//using LotteryWCF.Constract;
namespace LotteryNumsCollect
{
    public class Paijiang
    {
        static LotteryServiceClient s;
        public void GoPaiJiang(LotteryType type)
        {
            s = WcfProxy.GetProxy;
            List<LotteryNumsInfo> info = s.getIsNotPJ((int)type).ToList();
            foreach (LotteryNumsInfo ln in info)
            {
                try
                {

                    StringBuilder sb = new StringBuilder();
                    sb.AppendLine(type.ToString() + "==>" + DateTime.Now.ToString() + "," + ln.IssueNo + "期派奖开始");
                    s.UpdateLotteryFlag(1, ln.LotteryTypeID, ln.IssueNo);
                    //派奖开始
                    List<BetRecord> listOrders = s.getOrders(ln.IssueNo, (int)type).ToList();
                    List<BetRecord> listResult_bet = new List<BetRecord>();
                    List<ProfitLossInfo> listResult_prl = new List<ProfitLossInfo>();
                    foreach (BetRecord order in listOrders)
                    {
                        try
                        {
                            BetRecord record = JudgeWin(order, ln);
                            listResult_bet.Add(record);
                        }
                        catch(Exception ex) {
                            Console.WriteLine(ex.Message);
                        }
                    }
                    bool returnBool = s.UpdateOrdersWinInfo(new ObservableCollection<BetRecord>(listResult_bet));//更新中奖信息
                    //派奖结束
                    if (returnBool)
                        s.UpdateLotteryFlag(2, ln.LotteryTypeID, ln.IssueNo);
                    sb.AppendLine(type.ToString() + "==>" + DateTime.Now.ToString() + "," + ln.IssueNo + "期共有" + listResult_bet.Count.ToString() + "个订单");
                    sb.AppendLine(type.ToString() + "==>" + DateTime.Now.ToString() + "," + ln.IssueNo + "期派奖结束");
                    Console.WriteLine(sb.ToString());
                }
                catch (Exception e)
                {
                    s.UpdateLotteryFlag(0, ln.LotteryTypeID, ln.IssueNo);
                }
            }
        }
        private BetRecord JudgeWin(BetRecord record, LotteryNumsInfo ltyNum)
        {

            record.UpdateTime = DateTime.Now;
            record.WinMoney = 0;
            int winCount = 0;
            string winNum = string.Empty;
            string[] betNums ;
            string[] arr_winNum;
            string[] arr_odd=null;
            switch ((PlayType)record.PlayTypeID)
            {
                case PlayType._3xZhix  ://SSC三星直选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    if (record.PlayTypeRadioID == 1 || record.PlayTypeRadioID == 2)//后三直选
                        winNum = ltyNum.LotteryNums.Substring(2, 3);
                    else//前三直选
                        winNum = ltyNum.LotteryNums.Substring(0, 3);
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        if (nums.Length != 3&&nums.Length==1)
                        {
                            if (nums[0] == winNum)
                            {
                                winCount++;
                            }
                            continue;
                        }
                        if (!nums[0].Contains(winNum.First()))
                        {
                            continue;
                        }
                        if (!nums[1].Contains(winNum.Substring(1,1)))
                        {
                            continue;
                        }
                        if (!nums[2].Contains(winNum.Last()))
                        {
                            continue;
                        }
                        winCount += 1;
                    }
                    break;
                #endregion 
                case PlayType._3xZux   ://SSC三星组选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                     if (record.PlayTypeRadioID == 5 
                         || record.PlayTypeRadioID == 6
                         ||record.PlayTypeRadioID==7)//后三组选
                     {
                         winNum = ltyNum.LotteryNums.Substring(2, 3);
                     }
                     else//前三组选
                     {
                         winNum = ltyNum.LotteryNums.Substring(0, 3);
                     }
                    betNums = record.BetNums.Split('$');
                    if (record.PlayTypeRadioID == 6 || record.PlayTypeRadioID == 9)//买组3
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu3)//开组6或者豹子
                            break;
                        
                    }
                    else if (record.PlayTypeRadioID == 5 || record.PlayTypeRadioID == 8)//买组6
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu6)//开组3或者豹子
                            break;
                    }
                    else//组选混合
                    {
                        foreach (string num in betNums)
                        {
                            if (JudgeNumsType(winNum) != JudgeNumsType(num))//组选混合时形态不一致则未中奖
                                continue;
                            if (num.Contains(winNum.First())
                                && num.Contains(winNum.Substring(1, 1))
                                && num.Contains(winNum.Last()))
                                winCount += 1;
                        }
                        break;
                    }
                    foreach (string num in betNums)
                    {
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Substring(1, 1))
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion 
                case PlayType._2xZhix  ://SSC二星直选
                    #region 
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    if (record.PlayTypeRadioID == 11 || record.PlayTypeRadioID == 12)//后二直选
                        winNum = ltyNum.LotteryNums.Substring(3, 2);
                    else//前二直选
                        winNum = ltyNum.LotteryNums.Substring(0, 2);
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        if (nums.Length==1)
                        {
                            if (nums[0] == winNum)
                            {
                                winCount++;
                            }
                            continue;
                        }
                        if (!nums[0].Contains(winNum.First()))
                        {
                            continue;
                        }
                        if (!nums[1].Contains(winNum.Last()))
                        {
                            continue;
                        }
                        winCount += 1;
                    }
                    break;
                #endregion 
                case PlayType._2xZux   ://SSC二星组选
                    #region 
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                     if (record.PlayTypeRadioID == 15 
                         || record.PlayTypeRadioID == 16)//后二组选
                     {
                         winNum = ltyNum.LotteryNums.Substring(3, 2);
                     }
                     else//前二组选
                     {
                         winNum = ltyNum.LotteryNums.Substring(0, 2);
                     }
                    betNums = record.BetNums.Split('$');
                    if (record.PlayTypeRadioID == 15 || record.PlayTypeRadioID == 17)//买组二（不包含组3形态即2个号码相同)
                    {
                        if (winNum.Last() == winNum.First())
                            break;
                    }
                    else//组选二混合
                    {
                        foreach (string num in betNums)
                        {
                            if (JudgeNumsType(num) != JudgeNumsType(winNum))//组选二混合时形态不一直则未中奖
                                continue;
                            if (num.Contains(winNum.First())
                                && num.Contains(winNum.Last()))
                                winCount += 1;
                        }
                        break;
                    }
                    foreach (string num in betNums)
                    {
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._H1Zhix:
                    #region 
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(4, 1);//后一直选
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        if(num.Contains(winNum))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._Bddw    :
                    #region 
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums;
                    if (record.PlayTypeRadioID == 20)
                        winNum = winNum.Substring(2, 3);
                    if (record.PlayTypeRadioID == 21)
                        winNum = winNum.Substring(0, 3);
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        for (int i = 0; i < num.Length; i++)
                        {
                            if (winNum.Contains(num.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType._Ddw     :
                    #region 
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        if (num.Trim() == string.Empty)
                            continue;
                        string[] nums = num.Split(',');
                        for (int i = 0; i < winNum.Length; i++)
                        {
                            if (nums[i].Contains(winNum.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType._R3Zhix://RX三星直选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        bool isMatch = true;
                        string[] _nums = num.Split(',');
                        for (int i = 0; i < 5; i++)
                        {
                            if (_nums[i].Trim() == string.Empty)
                                continue;
                            else
                            {
                                if (!_nums[i].Contains(ltyNum.LotteryNums.Substring(i, 1)))
                                {
                                    isMatch = false;
                                    break;
                                }
                            }
                        }
                        if(isMatch)
                            winCount++;
                    }
                    break;
                    #endregion
                case PlayType._R3Zux://RX三星组选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    string str = record.PlayTypeDirection.Substring(record.PlayTypeDirection.IndexOf("(")+1,
                        record.PlayTypeDirection.IndexOf(")") - record.PlayTypeDirection.IndexOf("(")-2);
                    string[] checkboxs = str.Split(',');
                    foreach (string cb in checkboxs)
                    {
                        switch (cb.ToLower())
                        {
                            case "万":
                                winNum = winNum + ltyNum.LotteryNums.Substring(0, 1);
                                break;
                            case "千":
                                winNum = winNum + ltyNum.LotteryNums.Substring(1, 1);
                                break;
                            case "百":
                                winNum = winNum + ltyNum.LotteryNums.Substring(2, 1);
                                break;
                            case "十":
                                winNum = winNum + ltyNum.LotteryNums.Substring(3, 1);
                                break;
                            case "个":
                                winNum = winNum + ltyNum.LotteryNums.Substring(4, 1);
                                break;
                        }
                    }
                     betNums = record.BetNums.Split('$');
                    if (record.PlayTypeRadioID == 49)//买组3
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu3)//开组6或者豹子
                            break;
                        
                    }
                    else if (record.PlayTypeRadioID == 50)//买组6
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu6)//开组3或者豹子
                            break;
                    }
                    else//组选混合
                    {
                        foreach (string num in betNums)
                        {
                            if (JudgeNumsType(winNum) != JudgeNumsType(num))//组选混合时形态不一致则未中奖
                                continue;
                            if (num.Contains(winNum.First())
                                && num.Contains(winNum.Substring(1, 1))
                                && num.Contains(winNum.Last()))
                                winCount += 1;
                        }
                        break;
                    }
                    foreach (string num in betNums)
                    {
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Substring(1, 1))
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._R2Zhix://RX二星直选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                     betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        bool isMatch = true;
                        string[] _nums = num.Split(',');
                        for (int i = 0; i < 5; i++)
                        {
                            if (_nums[i].Trim() == string.Empty)
                                continue;
                            else
                            {
                                if (!_nums[i].Contains(ltyNum.LotteryNums.Substring(i, 1)))
                                {
                                    isMatch = false;
                                    break;
                                }
                            }
                        }
                       if(isMatch)
                            winCount++;
                    }
                    break;
                    #endregion
                case PlayType._R2Zux://RX二星组选
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    string str2 = record.PlayTypeDirection.Substring(record.PlayTypeDirection.IndexOf("(")+1,
                        record.PlayTypeDirection.IndexOf(")") - record.PlayTypeDirection.IndexOf("(")-2);
                    string[] checkboxs2 = str2.Split(',');
                    foreach (string cb in checkboxs2)
                    {
                        switch (cb.ToLower())
                        {
                            case "万":
                                winNum = winNum + ltyNum.LotteryNums.Substring(0, 1);
                                break;
                            case "千":
                                winNum = winNum + ltyNum.LotteryNums.Substring(1, 1);
                                break;
                            case "百":
                                winNum = winNum + ltyNum.LotteryNums.Substring(2, 1);
                                break;
                            case "十":
                                winNum = winNum + ltyNum.LotteryNums.Substring(3, 1);
                                break;
                            case "个":
                                winNum = winNum + ltyNum.LotteryNums.Substring(4, 1);
                                break;
                        }
                    }
                     betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        if (JudgeNumsType(winNum) != JudgeNumsType(num))//组选混合时形态不一致则未中奖
                            continue;
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Substring(1, 1))
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._Rbdw://RX任不定位
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums;
                    if (record.PlayTypeRadioID == 56)
                        winNum = winNum.Substring(2, 3);
                    if (record.PlayTypeRadioID == 57)
                        winNum = winNum.Substring(0, 3);
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        for (int i = 0; i < num.Length; i++)
                        {
                            if (winNum.Contains(num.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType._Rydw://RX任意定位
                    #region
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        for (int i = 0; i < winNum.Length; i++)
                        {
                            if (nums[i].Contains(winNum.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion

                case PlayType._3DZhix  :
                    #region
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        if (nums.Length != 3&&nums.Length==1)
                        {
                            if (nums[0] == winNum)
                            {
                                winCount++;
                            }
                            continue;
                        }
                        if (!nums[0].Contains(winNum.First()))
                        {
                            continue;
                        }
                        if (!nums[1].Contains(winNum.Substring(1,1)))
                        {
                            continue;
                        }
                        if (!nums[2].Contains(winNum.Last()))
                        {
                            continue;
                        }
                        winCount += 1;
                    }
                    break;
                #endregion 
                case PlayType._3DZux   :
                    #region
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    if (record.PlayTypeRadioID == 27)//买组3
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu3)//开组6或者豹子
                            break;
                        
                    }
                    else if (record.PlayTypeRadioID == 26)//买组6
                    {
                        if (JudgeNumsType(winNum) != NumType.Zu6)//开组3或者豹子
                            break;
                    }
                    else//组选混合
                    {
                        foreach (string num in betNums)
                        {
                            if (JudgeNumsType(winNum) != JudgeNumsType(num))//组选混合时形态不一致则未中奖
                                continue;
                            if (num.Contains(winNum.First())
                                && num.Contains(winNum.Substring(1, 1))
                                && num.Contains(winNum.Last()))
                                winCount += 1;
                        }
                        break;
                    }
                    foreach (string num in betNums)
                    {
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Substring(1, 1))
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion 
                case PlayType._3D2xZhix:
                    #region 
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(1, 2);
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        if (nums.Length==1)
                        {
                            if (nums[0] == winNum)
                            {
                                winCount++;
                            }
                            continue;
                        }
                        if (!nums[0].Contains(winNum.First()))
                        {
                            continue;
                        }
                        if (!nums[1].Contains(winNum.Last()))
                        {
                            continue;
                        }
                        winCount += 1;
                    }
                    break;
                #endregion 
                case PlayType._3D2xZux :
                    #region 
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(1, 2);
                    betNums = record.BetNums.Split('$');
                    if (record.PlayTypeRadioID == 31)//买组二（不包含组3形态即2个号码相同)
                    {
                        if (winNum.Last() == winNum.First())
                            break;
                    }
                    else//组选二混合
                    {
                        foreach (string num in betNums)
                        {
                            if (JudgeNumsType(num) != JudgeNumsType(winNum))//组选二混合时形态不一直则未中奖
                                continue;
                            if (num.Contains(winNum.First())
                                && num.Contains(winNum.Last()))
                                winCount += 1;
                        }
                    }
                    foreach (string num in betNums)
                    {
                        if (num.Contains(winNum.First())
                            && num.Contains(winNum.Last()))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._3DH1Zhix:
                    #region 
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(2, 1);//后一直选
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        if(num.Contains(winNum))
                            winCount += 1;
                    }
                    break;
                    #endregion
                case PlayType._3DBddw  :
                    #region 
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        for (int i = 0; i < num.Length; i++)
                        {
                            if (winNum.Contains(num.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType._3DDdw   :
                    #region 
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums;
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        for (int i = 0; i < winNum.Length; i++)
                        {
                            if (nums[i].Contains(winNum.Substring(i, 1)))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType._SSQBlue:
                    #region 
                    if (ltyNum.LotteryNums.Split(',').Length!=7)
                        break;
                    arr_winNum = ltyNum.LotteryNums.Split(',');
                    winNum = arr_winNum[6];
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        if (nums.Contains(winNum))
                            winCount++;
                    }
                    break;
                    #endregion
                case PlayType._SSQRed  :
                    #region 
                    if (ltyNum.LotteryNums.Split(',').Length!=7)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(0, ltyNum.LotteryNums.Length - 3);
                    arr_winNum=winNum.Split(',');
                    betNums = record.BetNums.Split('$');
                    foreach (string num in betNums)
                    {
                        string[] nums = num.Split(',');
                        foreach (string _num in arr_winNum)
                        {
                            if (nums.Contains(_num))
                                winCount++;
                        }
                    }
                    break;
                    #endregion
                case PlayType.NSSCBdw  :
                    #region 
                    if (ltyNum.LotteryNums.Length != 5)
                        break;
                    winNum = ltyNum.LotteryNums;
                    if (record.PlayTypeRadioID == 38)
                        winNum = winNum.Substring(4, 1);
                    if (record.PlayTypeRadioID == 39)
                        winNum = winNum.Substring(3, 2);
                    if (record.PlayTypeRadioID == 40)
                        winNum = winNum.Substring(2, 3);
                    if(!winNum.Contains(record.BetNums))
                    {
                        winCount++;
                        record.WinMoney = record.BetMoney * 2;
                    }
                    break;
                    #endregion
                case PlayType.N3DBdw   :
                    #region 
                    if (ltyNum.LotteryNums.Length != 3)
                        break;
                    winNum = ltyNum.LotteryNums;
                    if (record.PlayTypeRadioID == 42)
                        winNum = winNum.Substring(2, 1);
                    if (record.PlayTypeRadioID == 43)
                        winNum = winNum.Substring(1, 2);
                    if (!winNum.Contains(record.BetNums))
                    {
                        winCount++;
                        record.WinMoney = record.BetMoney * 2;
                    }
                    break;
                    #endregion
                case PlayType.NSSQBlue :
                    #region 
                    if (ltyNum.LotteryNums.Split(',').Length!=7)
                        break;
                    arr_winNum = ltyNum.LotteryNums.Split(',');
                    winNum = arr_winNum[6];
                    if (!winNum.Contains(record.BetNums))
                    {
                        winCount++;
                        record.WinMoney = record.BetMoney * 2;
                    }
                    break;
                    #endregion
                case PlayType.NSSQRed  :
                    #region 
                    if (ltyNum.LotteryNums.Split(',').Length!=7)
                        break;
                    winNum = ltyNum.LotteryNums.Substring(0, ltyNum.LotteryNums.Length - 3);
                    if (!winNum.Contains(record.BetNums))
                    {
                        winCount++;
                        record.WinMoney = record.BetMoney * 2;
                    }
                    break;
                    #endregion
            }
            record.IsWin = winCount == 0 ? 0 : 1;
            record.WinCount = winCount;
            if ((PlayType)record.PlayTypeID != PlayType.N3DBdw
                && (PlayType)record.PlayTypeID != PlayType.NSSCBdw
                && (PlayType)record.PlayTypeID != PlayType.NSSQBlue
                && (PlayType)record.PlayTypeID != PlayType.NSSQRed)
            {
                arr_odd = record.OddBonus.Split('/');
                record.WinMoney = Math.Round(Convert.ToDouble(arr_odd[0]) * record.BetMultiple*record.WinCount, 2);
            }
            return record;
        }
        NumType JudgeNumsType(string num)
        {
            if (num.Length == 3)
            {
                string num_1 = num.Substring(0, 1);
                string num_2 = num.Substring(1, 1);
                string num_3 = num.Substring(2, 1);
                if (num_1 == num_2 && num_2 == num_3)
                    return NumType.BaoZ;
                else if (num_1 != num_2 && num_1 != num_3 && num_2 != num_3)
                {
                    return NumType.Zu6;
                }
                else
                    return NumType.Zu3;
            }
            else
            {
                string num_1 = num.Substring(0, 1);
                string num_2 = num.Substring(1, 1);
                if (num_1 == num_2)
                    return NumType.Zu3;
                else
                    return NumType.Zu6;
            }
        }
    }
    public enum LotterType
    {
        SSC = 1,
        _3D = 2,
        SSQ = 3
    }
    public enum NumType
    {
        Zu6=1,
        Zu3=2,
        BaoZ=3
    }
    public enum PlayType
    {
        _3xZhix  = 1,
        _3xZux   = 2,
        _2xZhix  = 3,
        _2xZux   = 4,
        _H1Zhix  = 5,
        _Bddw       = 6,
        _Ddw         = 7,
        _3DZhix      = 8,
        _3DZux    = 9,
        _3D2xZhix   = 10,
        _3D2xZux    = 11,
        _3DH1Zhix   = 12,
        _3DBddw     = 13,
        _3DDdw      = 14,
        _SSQBlue    = 15,
        _SSQRed     = 16,
        NSSCBdw     = 17,
        N3DBdw      = 18,
        NSSQBlue     = 19,
        NSSQRed     = 20,

        _R3Zhix = 21,
        _R3Zux = 22,
        _R2Zhix = 23,
        _R2Zux = 24,
        _Rydw = 25,
        _Rbdw = 26
    }
}
